package com.example.controller;

import com.example.entity.SpotObjectCensus;
import com.example.entity.SpotObjectPlan;
import com.example.service.SpotObjectPlanService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 实施对象界面
 */
@RestController
@RequestMapping("api/spotObjectPlan")
public class SpotObjectPlanController {

    @Autowired
    public SpotObjectPlanService spotObjectPlanService;

   /**
     * 查询所有数据
     *
     * @param
     * @param
     * @return
     */
    @ApiOperation(value = "查询实施对象计划的所有数据", notes = "获取列表信息")
    @RequestMapping(value = "findList", method = RequestMethod.POST)
    private Map<String, Object> findList(@RequestBody SpotObjectPlan spotObjectPlan) {
        Map<String, Object> resultMap = spotObjectPlanService.findList(spotObjectPlan);
        return resultMap;
    }

    /**
     * 新增数据
     */
    @ApiOperation(value = "新增实施对象的所有数据", notes = "新增实施对象信息")
    @RequestMapping(value = "insert", method = RequestMethod.POST)
    private Map<String, Object> insert(@RequestBody SpotObjectPlan spotObjectPlan) {
        Map<String, Object> resultMap = spotObjectPlanService.insert(spotObjectPlan);
        return resultMap;
    }

    /**
     * 批量修改数据
     */

    @ApiOperation(value = "修改的所有数据", notes = "修改对象信息")
    @RequestMapping(value = "update", method = RequestMethod.POST)
    private Map<String, Object> update(@RequestBody Map map) {
        Map<String, Object> resultMap = spotObjectPlanService.update(map);
        return resultMap;
    }


    /**
     * 批量删除数据
     */
    @ApiOperation(value = "维保计划的批量删除", notes = "删除信息")
    @RequestMapping(value = "delete", method = RequestMethod.POST)
    private Map<String, Object> delete(@RequestBody Map map) {
        Map<String, Object> resultMap = spotObjectPlanService.delete(map);
        return resultMap;
    }

    /**
     * 批量发送通知数据
     */
    @ApiOperation(value = "任务功能批量发送通知", notes = "任务功能批量发送通知")
    @RequestMapping(value = "sendMessage", method = RequestMethod.POST)
    private Map<String, Object> sendMessage(@RequestBody Map map) {
        Map<String, Object> resultMap = spotObjectPlanService.sendMessage(map);
        return resultMap;
    }

    /**
     * 实施对象导出
     */
    @ApiOperation(value = "实施对象导出", notes = "实施对象导出")
    @RequestMapping(value = "exportExcelObj")
    private Map<String,Object> exportExcelObj(@RequestBody Map map) {
        Map<String,Object> resultMap = spotObjectPlanService.exportExcelObj(map);
        return resultMap;
    }

   /* *//**
     * 实施对象导出记录表
     *//*
    @ApiOperation(value = "实施对象导出", notes = "实施对象导出")
    @RequestMapping(value = "exportExcelClown")
    private Map<String,Object> exportExcelClown(@RequestBody Map map) {
        Map<String,Object> resultMap = spotObjectPlanService.exportExcelClown(map);
        return resultMap;
    }*/

    /**
     * 维保质量统计
     */
    @ApiOperation(value = "维保质量统计", notes = "维保质量统计")
    @RequestMapping(value = "spotObjectCensus")
    private Map<String,Object> spotObjectCensus(@RequestBody Map map) {
        Map<String,Object> resultMap = spotObjectPlanService.spotObjectCensus(map);
        return resultMap;
    }

    /**
     * 维保质量统计详情
     */
    @ApiOperation(value = "维保质量统计详情", notes = "维保质量统计详情")
    @RequestMapping(value = "queryPlanDetails")
    private Map<String,Object> queryPlanDetails(@RequestBody Map map) {
        Map<String,Object> resultMap = spotObjectPlanService.queryPlanDetails(map);
        return resultMap;
    }



    /**
     * app端的查询未完成维保记录
     */
    @ApiOperation(value = "app端查询维保记录", notes = "查询维保记录")
    @RequestMapping(value = "findRecordApp")
    private Map<String,Object> findRecordApp(@RequestBody SpotObjectPlan spotObjectPlan) {
        Map<String,Object> resultMap = spotObjectPlanService.findRecordApp(spotObjectPlan);
        return resultMap;
    }

    /**
     * app端的查询已完成维保记录
     */
    @ApiOperation(value = "app端查询维保记录", notes = "查询维保记录")
    @RequestMapping(value = "queryFinishRecordApp")
    private Map<String,Object> queryFinishRecordApp(@RequestBody SpotObjectPlan spotObjectPlan) {
        Map<String,Object> resultMap = spotObjectPlanService.queryFinishRecordApp(spotObjectPlan);
        return resultMap;
    }




}
